BIN=process
SRC=$(shell ls *.c)
OBJ=$(SRC:.c=.o)
CC=gcc -std=c99
RM=rm -f

$(BIN):$(OBJ)
	@$(CC) $^ -o $@
	@echo 把$^链接成$@
%.o:%.c
	@$(CC) -c $< -o $@
	@echo 把$<编译成$@
.PHONY:clean
clean:
	@$(RM) *.o $(BIN)

#test.o:test.c
#	gcc -c test.c -o test.o
#test:test.o
#	gcc test.o -o test
#.PHONY:clean
#clean:
#	rm -f test.o test


#test:test.o
#	gcc test.o -o test
#test.o:test.s
#	gcc -c test.s -o test.o
#test.s:test.i
#	gcc -S test.i -o test.s
#test.i:test.c
#	gcc -E test.c -o test.i
#.PHONY:clean
#clean:
#	rm -f *.i *.s *.o test




#test:test.c
#	gcc test.c -o test
#
#.PHONY:clean
#clean:
#	rm -f test
